/* 储存供应商管理-认证列表api */
import { ajaxService } from '@/utils/request';

const env = import.meta.env;
let baseURL = env.VITE_SUPPLOER_URL;

// 获取供应商认证产品
export function getSupplierAuthProduct(params: any) {
  return ajaxService({
    url: '/supplier/auth/show/need/product',
    method: 'get',
    baseURL,
    params,
  });
}

// 获取供应商样品试用认证产品
export function getSupplierAuthTaskProduct(params: any) {
  return ajaxService({
    url: '/supplier/auth/show/task/product',
    method: 'get',
    baseURL,
    params,
  });
}

// 新增供应商认证产品
export function postSupplierAuthProduct(data: any) {
  return ajaxService({
    url: '/supplier/auth/product/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 新增供应商产品
export function postSupplierProduct(data: any) {
  return ajaxService({
    url: '/supplier/auth/product/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 查询供应商产品
export function getSupplierProduct(params: any) {
  return ajaxService({
    url: '/supplier/auth/get',
    method: 'get',
    baseURL,
    params,
  });
}

// 删除供应商产品
export function delSupplierProduct(params: any) {
  return ajaxService({
    url: '/supplier/auth/product/del',
    method: 'delete',
    baseURL,
    params,
  });
}

// 编辑（任务下达）
export function putSupplierAuth(data: any) {
  return ajaxService({
    url: '/supplier/auth/edit',
    method: 'put',
    baseURL,
    data,
  });
}

// 新增验厂参与人
export function postSupplierMans(data: any) {
  return ajaxService({
    url: '/supplier/auth/mans/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 删除供应商产品
export function delSupplierMans(params: any) {
  return ajaxService({
    url: '/supplier/auth/mans/del',
    method: 'delete',
    baseURL,
    params,
  });
}

// 添加供应商认证报告
export function addSupplierRecord(data: any) {
  return ajaxService({
    url: '/supplier/auth/record/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 供应商认证员工端接口
export function getSupplierStaffList(params: any) {
  return ajaxService({
    url: '/supplier/auth/list/getAll/staff',
    method: 'get',
    baseURL,
    params,
  });
}

// 获取已经审核完的供应商列表(管理端)
export function getAllIdentification(params: any) {
  return ajaxService({
    url: '/supplier/list/getAllIdentification',
    method: 'get',
    baseURL,
    params,
  });
}
